<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/Public/static/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/Public/static/css/public.css" media="all" />
</head>
<body class="childrenBody">
<form class="layui-form layui-form-pane" style="width:90%;padding-left: 5%;">
	<div class="layui-form-item">
	<label class="layui-form-label" for="order_no">订单号</label>
	<div class="layui-input-block">
		<input type="text" name="order_no" id="order_no" placeholder="订单号"  autocomplete="off"  maxlength="64" value=""  class="layui-input">
	</div>
</div><div class="layui-form-item">
	<label class="layui-form-label" for="kehu_id">客户</label>
	<div class="layui-input-block">
		<select name="kehu_id" lay-search  id="kehu_id" >
			<option value="">请选择客户</option>
			
                <volist name='kehuList' id='v'>
                    <option value='{$v.id}'>{$v.name}</option>
                </volist>
                
		</select>
	</div>
</div><div class="layui-form-item">
	<label class="layui-form-label" for="xs_rq">销售日期</label>
	<div class="layui-input-block">
		<input type="text" readonly  name="xs_rq" id="xs_rq" placeholder="年-月-日 时:分:秒"  autocomplete="off"  class="layui-input">
	</div>
</div>
<div class="layui-form-item">
	<label class="layui-form-label" for="az_rq">安装日期</label>
	<div class="layui-input-block">
		<input type="text" readonly  name="az_rq" id="az_rq" placeholder="年-月-日 时:分:秒"  autocomplete="off"  class="layui-input">
	</div>
</div>
<div class="layui-form-item">
	<label class="layui-form-label" for="dingjin">定金</label>
	<div class="layui-input-block">
		<input type="number" name="dingjin" id="dingjin" placeholder="定金"  autocomplete="off"  step="1.0E-6" value=""  class="layui-input">
	</div>
</div><div class="layui-form-item">
	<label class="layui-form-label" for="jiage">价格</label>
	<div class="layui-input-block">
		<input type="number" name="jiage" id="jiage" placeholder="价格"  autocomplete="off"  step="1.0E-6" value=""  class="layui-input">
	</div>
</div><div class="layui-form-item">
	<label class="layui-form-label" for="baizhu">备注</label>
	<div class="layui-input-block">
		<textarea name="baizhu" placeholder="备注" id="baizhu" class="layui-textarea"  >{$info.baizhu}</textarea>
	</div>
</div><div class="layui-form-item">
	<label class="layui-form-label" for="create_time">创建时间</label>
	<div class="layui-input-block">
		<input type="text" readonly  name="create_time" id="create_time" placeholder="年-月-日 时:分:秒"  autocomplete="off"  class="layui-input">
	</div>
</div>
<div class="layui-form-item">
	<label class="layui-form-label" for="update_time">更新时间</label>
	<div class="layui-input-block">
		<input type="text" readonly  name="update_time" id="update_time" placeholder="年-月-日 时:分:秒"  autocomplete="off"  class="layui-input">
	</div>
</div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="addData">提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script type="text/javascript" src="/Public/static/js/jquery-3.2.0.min.js"></script>
<script type="text/javascript" src="/Public/static/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['form','layer','laydate','upload','layedit'],function(){
        let form = layui.form,
		laydate = layui.laydate,
		upload = layui.upload,
            layedit = layui.layedit,
        layer = parent.layer === undefined ? layui.layer : top.layer;

        
laydate.render({
                          elem: '#xs_rq'
                          ,theme: '#01AAED'
                          ,type: 'date'
                          ,trigger: 'click'
                        });

laydate.render({
                          elem: '#az_rq'
                          ,theme: '#01AAED'
                          ,type: 'date'
                          ,trigger: 'click'
                        });

laydate.render({
                          elem: '#create_time'
                          ,theme: '#01AAED'
                          ,type: 'datetime'
                          ,trigger: 'click'
                        });

laydate.render({
                          elem: '#update_time'
                          ,theme: '#01AAED'
                          ,type: 'datetime'
                          ,trigger: 'click'
                        });


        form.on("submit(addData)",function(){
            let index = layer.msg('数据提交中，请稍候',{icon: 16,time:false});
            $.post("/admin/Dingdan/add",{para:$('form').serialize()},function(res){
                window.parent.window.parent.toast(res.info,res.code);
                layer.close(index);
                if(0 === res.code){
                    parent.layer.closeAll();
                    window.parent.tablist.reload();
                }
            });
            return false;
        });
    });
</script>
</body>
</html>